derivative from first principle method